package com.example.mydesignmodule.yuanxing;

/**
 * @author tgw
 * @date 2021/2/25
 * @describe
 */
public class PrototypeRunMain {

    public static void main(String[] args) throws CloneNotSupportedException {
       WordDocument wordDocument= new WordDocument();
        DocumentCache.loadCache(wordDocument);

        Document clonedShape = (Document) DocumentCache.getShape(wordDocument.getType());
        System.out.println(clonedShape.toString());
        //这里改变了值 克隆出来的还是不改变
        wordDocument.setType("fsafas");
        System.out.println(clonedShape.toString());
        System.out.println(wordDocument.toString());
    }
}
